import React, { useEffect, useState } from 'react';


const Home = () => {
    const [ count, setCount ] = useState(0)
    const addCount = () => {
        let newCount = count
        setCount(newCount+=1)
    }
    const [ total, setTotal ] = useState(100)
    const minusTotal = () => {
        let newTotal = total
        setTotal(newTotal-=1)
    }
    useEffect(() => {
        console.log(111);
    },[])
    
    return (<>
        <p>{count}</p>
        <button onClick={addCount}>count++</button>
        <p>{total}</p>
        <button onClick={minusTotal}>total++</button>
    </>)
}

export default Home